{% extends "blog/base_blog.html" %}

{% load i18n %}
{% load markup %}

{% block title %}{{ object_blog.title }}{% endblock %}
{% block body_class %}{{ block.super }} post_detail{% endblock %}
{% block body_id %}post_{{ object_blog.id }}{% endblock %}


{% block content_title %}
  <h2>{{ object_blog.title }} hola</h2>
  <p class="other_posts">
    {% if object_blog.get_previous_by_publish %}
    <a class="previous" href="{{ object_blog.get_previous_post.get_absolute_url }}" title="{% trans "View previous post" %}">&laquo; {{ object_blog.get_previous_post }}</a>
    {% endif %}
    {% if object_blog.get_next_by_publish %}
    | <a class="next" href="{{ object_blog.get_next_post.get_absolute_url }}" title="{% trans "View next post" %}">{{ object_blog.get_next_post }} &raquo;</a>
    {% endif %}
  </p>
{% endblock %}


{% block content %}
  {% load blog comments tagging_tags inlines markup %}

  <p class="date">{{ object_blog.publish|date:"j F Y" }}</p>

  <div class="body_blog">
    {{ object_blog.body|markdown }}
  </div>

  {% tags_for_object object_blog as tag_list %}
  {% if tag_list %}
  <p class="inline_tag_list"><strong>{% trans "Related tags" %}:</strong>
    {% for tag in tag_list %}
    {{ tag }}{% if not forloop.last %}, {% endif %}
    {% endfor %}
  </p>
  {% endif %}

  {% get_comment_list for object_blog as comment_list %}
  {% if comment_list %}
  <div id="comments">
    <a name="comments"></a>
    <h3 class="comments_title">{% trans "Comments" %}</h3>
    {% for comment in comment_list %}
      {% if comment.is_public %}
      <div class="comment">
        <h5 class="name">
          <a name="c{{ comment.id }}" href="{{ comment.get_absolute_url }}" title="{% trans "Permalink to" %} {% blocktrans with comment.user_name as user_name %}{{ user_name }}'s{% endblocktrans %} {% trans "comment" %}" class="count">{{ forloop.counter }}</a>
          {% if comment.user_url %}<a href="{{ comment.user_url }}" title="{% trans "View" %} {% blocktrans with comment.user_name as user_name %}{{ user_name }}'s{% endblocktrans %} {% trans "website" %}">{{ comment.user_name }}</a>{% else %}{{ comment.user_name }}{% endif %} {% trans "says" %}...
        </h5>
        {{ comment.comment|urlizetrunc:"60"|markdown:"safe" }}
        <p class="date">{% trans "Posted at" %} {{ comment.submit_date|date:"P" }} {% trans "on" %} {{ comment.submit_date|date:"F j, Y" }}</p>
      </div>
      {% endif %}
    {% endfor %}
  </div>
  {% endif %}
  {% if object_blog.allow_comments %}

    <div class="comentarios">
    {% render_comment_form for object_blog %}
    </div>

  {% else %}
    <div id="comment_form">
      <h3>{% trans "Comments are closed" %}.</h3>
      <p>{% trans "Comments have been closed for this post" %}.</p>
    </div>
  {% endif %}
{% endblock %}
